package cn.chencaiju.day12;

public class InterruptTest {
	public static void main(String[] args) throws InterruptedException {
		Thread t=new Thread(new MyInterrupt());
		t.start();
		Thread.sleep(2000);
		t.interrupt();
		System.out.println("主线程。。。");
	}
}
class MyInterrupt implements Runnable {

	@Override
	public void run() {
		while(!Thread.interrupted()) {
			try {
				Thread.sleep(1000);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
			System.out.println("qwer!");
		}
		
	}
	
}
